package com.study.component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @Author tanglingyu
 * @Date: 2021/08/11/ 21:09
 * @Description
 */
//@Configuration
public class Mvc1 extends WebMvcConfigurationSupport {

  public void addInterceptors(InterceptorRegistry registry) {
    InterceptorRegistration registration = registry.addInterceptor(new HandlerInterceptor() {
      @Override
      public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
          Object handler, Exception ex) throws Exception {
      }
    });
    registration.addPathPatterns(new String[]{"/**"});
    registration.excludePathPatterns(new String[]{"/**/*.html", "/**/*.js", "/**/*.css", "/**/*.woff", "/**/*.ttf"});
  }

}
